# -*- coding:UTF-8 -*-

# author:user
# contact: test@test.com
# datetime:2021/10/19 11:19
# software: PyCharm

"""
文件说明：
    
"""
import asyncio
from rasa.core.agent import Agent
from rasa.utils.endpoints import EndpointConfig

async def test_agent():
    endpoint = EndpointConfig(url="http://localhost:5055/webhook")
    agent = Agent.load(
        "../models/20211019-102725.tar.gz",
        action_endpoint=endpoint
    )
    result = await agent.handle_text("你好")
    print("结果为",result)

loop = asyncio.get_event_loop()
loop.run_until_complete(test_agent())